package br.com.felinelayer.client.clientSwing;

import br.com.felinelayer.client.IClientFactory;
import javax.swing.*;

/**
 *
 */
public class ClientSwing extends br.com.felinelayer.client.Client {

    @SuppressWarnings( "ResultOfObjectAllocationIgnored" )
    public static void main( String[] args ) {
        new ClientSwing( args );
    }

    private ClientSwing( String[] args ) {
        super( args );
        // Get the currently installed look and feel
        LookAndFeel lf = UIManager.getLookAndFeel();
        // Install a different look and feel; specifically, the Windows look and feel
        try {
            UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
        } catch ( ClassNotFoundException | InstantiationException | IllegalAccessException |
                UnsupportedLookAndFeelException e ) {
        }
    }

    @Override
    public void doProcessMessageReceived( Runnable runnable ) {
        SwingUtilities.invokeLater( runnable );
    }

    @Override
    protected void doShowMessage( String value ) {
        JOptionPane.showMessageDialog( null, value, "Informação", JOptionPane.INFORMATION_MESSAGE );
    }

    @Override
    protected String doShowInput( String value ) {
        return JOptionPane.showInputDialog( null, value, "Titulo", 1 );
    }

    @Override
    protected IClientFactory doCreateClientFactory() {
        return new ClientSwingFactory();
    }
}
